package com.yunji.cabinet.enums;

import com.yunji.common.utils.bean.BeanUtils;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.cabinet.enums
 * @Title: CellStatus
 * @Description: 货柜格子状态
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-04-13 11:59:07      V1.0        HuaAo       新建类
 */

public enum CellStatus {
    UNABLE(0, "无货"),
    ENABLE(1, "有货");
    private final Integer code;
    private final String text;

    CellStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(String code) {
        if (BeanUtils.isNull(code)) {
            return null;
        }
        CellStatus[] enums = CellStatus.values();
        for (CellStatus e : enums) {
            if (e.code.equals(code)) {
                return e.text;
            }
        }
        return null;
    }


}
